﻿/**
 * Licensed to Open-Ones Group under one or more contributor license
 * agreements. See the NOTICE file distributed with this work
 * for additional information regarding copyright ownership.
 * Open-Ones Group licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a
 * copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
namespace IPresenter
{
    using System;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Text;

    /// <summary>
    /// Create animation for Main Form
    /// </summary>
    public class IntroduceApplication
    {
        /// <summary>
        /// Name of Application
        /// </summary>
        public const string NAME_APPLICATION = "iPresenter 0.1.0";

        /// <summary>
        /// Author of Application
        /// </summary>
        public static string Author = "Innova Presentation - "+System.DateTime.Now.ToShortDateString();

        /// <summary>
        /// Width of Form
        /// </summary>
        public const int WIDTH = 422;

        /// <summary>
        /// Height of Form
        /// </summary>
        public const int HEIGHT = 579;

        /// <summary>
        /// Coordinate Y of Name Application
        /// </summary>
        private const int YN = 20;

        /// <summary>
        /// Coordinate Y of Author
        /// </summary>
        private const int YA = 300;

        /// <summary>
        /// Coordinate X of Author
        /// </summary>
        private int intXA = WIDTH - 110;

        /// <summary>
        /// Coordinate X of Name Application
        /// </summary>
        private int intXN = WIDTH - 30;

        /// <summary>
        /// Gets or sets intXN
        /// </summary>
        public int IntXN
        {
            get { return intXN; }
            set { intXN = value; }
        }

        /// <summary>
        /// Gets or sets intXA
        /// </summary>
        public int IntXA
        {
            get { return intXA; }
            set { intXA = value; }
        }

        /// <summary>
        /// Show string into Form
        /// </summary>
        /// <param name="g">Virtual graphics use to draw string</param>
        public void Draw(Graphics g)
        {
            Font f = new Font("Arial", 16);
            Bitmap bmp = Properties.Resources.MainForm;
            g.DrawImage(bmp, new Rectangle(0, 0, 422, 400), new Rectangle(0, 0, 422, 400), GraphicsUnit.Pixel);
            g.DrawString(NAME_APPLICATION, f, new SolidBrush(Color.Red), new PointF(this.intXN, YN));
            g.DrawImage(Properties.Resources.welcome, new Point(120, 100));
            g.DrawString(Author, f, new SolidBrush(Color.Red), new PointF(this.intXA, YA));
            if (this.intXA < -180)
            {
                this.intXA = WIDTH - 110;
                this.intXN = WIDTH - 30;
            }
            else
            {
                this.intXA -= 5;
                this.intXN -= 5;
            }
        }
    }
}
